//
//  AroundDetailController.m
//  youthNote
//
//  Created by huangrensheng on 16/5/30.
//  Copyright © 2016年 laber. All rights reserved.
//

#import "AroundDetailController.h"

@interface AroundDetailController()<UIWebViewDelegate>

@property (nonatomic, strong) UIWebView *webView;

@end

@implementation AroundDetailController

- (void)viewDidLoad{
    [super viewDidLoad];
    [self createWithLeftStyle:@{@"type":@"back"} middleStyle:@{@"type":@"title",@"title":@"资讯详情"} rightStyle:nil];
    
    self.webView = [[UIWebView alloc] init];
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.manew.com/thread-89924-1-1.html"]]];
    self.webView.delegate = self;
    [self.view addSubview:self.webView];
    [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView{
    NSString *lJs = @"document.documentElement.innerHTML";
    //    NSString *lJs2 = @"document.title";
    NSString *lHtml1 = [webView stringByEvaluatingJavaScriptFromString:lJs];
    //    NSString *lHtml2 = [webView stringByEvaluatingJavaScriptFromString:lJs2];
    NSLog(@"end - - %@",lHtml1);
}

- (void)webViewDidStartLoad:(UIWebView *)webView{
    NSString *lJs = @"document.documentElement.innerHTML";
//    NSString *lJs2 = @"document.title";
    NSString *lHtml1 = [webView stringByEvaluatingJavaScriptFromString:lJs];
//    NSString *lHtml2 = [webView stringByEvaluatingJavaScriptFromString:lJs2];
    NSLog(@"start - - %@",lHtml1);
}


@end
